Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        control         = GetComponent <CharacterController>();
        control.enabled = true;

        coroutine = DoCheck();
        StartCoroutine(coroutine);
        BGM         = GameObject.FindWithTag("GameController");
        brainOfPain = BGM.GetComponent <PainScript>();

        rotation = transform.rotation.eulerAngles.y;

        animCtrl = harry.GetComponent <Animator>();
    }
Exemplo n.º 2
0
 public void Touch()
 {
     if (action == null)
     {
         //Debug.Log("Touched");
     }
     else
     {
         if (action == "pain")
         {
             System.Random r    = new System.Random();
             int           rInt = r.Next(0, 2);
             //Debug.Log("Num: " + rInt);
             if (rInt == 0)
             {
                 //Debug.Log("Pain");
                 GameObject tmpScript = new GameObject();
                 PainScript ps        = tmpScript.AddComponent <PainScript>();
                 tmpScript.transform.parent = GameObject.Find("Tmp").transform;
             }
         }
     }
 }