public static jump instance; //자기자신을 변수로 담습니다. // public Animator anim; // Use this for initialization void Awake() { if (jump.instance == null) //incetance가 비어있는지 검사합니다. { jump.instance = this; //자기자신을 담습니다. } }
public static event Action <EnemyBehaviour> OnDie; //Send message to game manager, might be sent from player void Start() //or Awake()? or OnEnable()? { player = GameObject.FindWithTag("Player"); enemyRB = GetComponent <Rigidbody2D>(); moveLeft = new moveLeft(); moveRight = new moveRight(); idle = new idle(); jump = new jump(); moveToLocation = new moveToLocation(); //add behavior to command list patrolingBehaviorCommands.Add(moveLeft); patrolingBehaviorCommands.Add(moveLeft); patrolingBehaviorCommands.Add(moveLeft); patrolingBehaviorCommands.Add(moveLeft); patrolingBehaviorCommands.Add(moveLeft); patrolingBehaviorCommands.Add(moveRight); patrolingBehaviorCommands.Add(moveRight); patrolingBehaviorCommands.Add(moveRight); patrolingBehaviorCommands.Add(moveRight); patrolingBehaviorCommands.Add(moveRight); //chaseBehaviorCommands.Add(moveToLocation); patrolSlot = maxPatrolSlot; chaseSlot = maxChaseSlot; Invoke("EnemyPatrol", UnityEngine.Random.Range(0.2f, 2f)); //Cheat to make the goombas behave not in unison }
void Start() { charge = chargestart; rb = GetComponent <Rigidbody>(); otherscript = character.GetComponent <jump>(); otherscript1 = character.GetComponent <tricks>(); score = otherscript1.score; }
// Use this for initialization void Start() { randomDirection = new System.Random(); foreach (String device in Microphone.devices) { // Debug.Log(device); } GameObject pl1 = GameObject.Find("player1"); Player1Jump = (jump)pl1.GetComponent(typeof(jump)); //Player1Jump.Jump(); GameObject pl2 = GameObject.Find("player2"); Player2Jump = (jump)pl2.GetComponent(typeof(jump)); // Player2Jump.Jump(); }