This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace com.mindshaft.test { | |
public class DefaultParamTest : MonoBehaviour { | |
void Update() { | |
DefaultParamTest(); | |
} | |
private void DefaultParamTest(int param = 0) { | |
Debug.Log("param: " + param); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_) | |
//Permission is hereby granted, free of charge, to any person obtaining a copy | |
//of this software and associated documentation files (the "Software"), to deal | |
//in the Software without restriction, including without limitation the rights | |
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
//copies of the Software, and to permit persons to whom the Software is | |
//furnished to do so, subject to the following conditions: | |
//The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class UnityBulkReplaceTool : MonoBehaviour | |
{ | |
public GameObject objectToReplace = null; | |
public GameObject objectToSpawn = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 DIALOGEX 0, 0, 309, 200 | |
STYLE DS_FIXEDSYS | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | |
CAPTION "ScreenSel" | |
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US | |
FONT 8, "MS Shell Dlg", FW_NORMAL, FALSE, 1 | |
{ | |
CONTROL "Play!", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 193, 178, 50, 14 | |
CONTROL "Quit", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 252, 178, 50, 14 | |
CONTROL "", -1, BUTTON, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 7, 3, 295, 108 | |
CONTROL "", 1001, STATIC, SS_BITMAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, 9, 9, 291, 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 DIALOGEX 0, 0, 290, 56 | |
STYLE DS_FIXEDSYS | DS_MODALFRAME | DS_CONTROL | WS_CHILD | WS_SYSMENU | |
CAPTION "" | |
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US | |
FONT 8, "MS Shell Dlg", FW_NORMAL, FALSE, 1 | |
{ | |
CONTROL "Screen resolution", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 7, 9, 56, 8 | |
CONTROL "", 1010, COMBOBOX, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 73, 7, 84, 90 | |
CONTROL "Windowed", 1009, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 169, 7, 49, 10 | |
CONTROL "Graphics quality", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 7, 26, 52, 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List xPositions; | |
List yPositions; | |
foreach target { | |
xPositions.Add(target.x); | |
yPositions.Add(target.y); | |
} | |
maxX = Max(xPositions); | |
maxY = Max(yPositions); | |
minX = Min(xPositions); | |
minY = Min(yPositions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using com.mindshaft.overtime.collision; | |
using UnityEngine; | |
namespace com.mindshaft.overtime.physics { | |
public class RaycastCollisionDetection : IEntityCollisionDetection { | |
private BoxCollider _collider; | |
private Rect _collisionRect; | |
private LayerMask _collisionMask; | |
private LayerMask _playerMask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void obtainScreenBounds() { | |
float cameraToPlayerDistance = Mathf.Abs(Camera.mainCamera.transform.position.z - transform.position.z); | |
minScreenBounds = Camera.main.ScreenToWorldPoint(new Vector3(0, 0, cameraToPlayerDistance)); | |
maxScreenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, cameraToPlayerDistance)); | |
} | |
private void checkScreenBoundaries() { | |
transform.position = new Vector3( | |
Mathf.Clamp(transform.position.x, (minScreenBounds.x) + 1, (maxScreenBounds.x) - 1), | |
Mathf.Clamp(transform.position.y, (minScreenBounds.y) + 1, (maxScreenBounds.y) - 1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
player.transform.position = new Vector3( | |
Mathf.Clamp(player.transform.position.x, -8.0f, 8.0f), | |
Mathf.Clamp(player.transform.position.y, -10.0f, 10.0f), | |
player.transform.position.z); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Color[] flashColors; | |
private float flashLerpDuration = 0.10f; | |
private float flashInvokeDuration = 0.5f; | |
void Start() { | |
// All other initialization code here... | |
flashColors = new Color[2]; | |
flashColors[0] = Color.magenta; | |
flashColors[1] = Color.white; | |
} |
OlderNewer