示例#1
0
 // Use this for initialization
 private void Start()
 {
     if (gameObject.name != "Pig")
     {
         audioSource = GetComponent <AudioSource>();
     }
     try
     {
         levelManager = GameObject.Find("CreateAnimalPoints").GetComponent <LevelManager>();
     }
     catch
     {
         linelevelManager = GameObject.Find("LineCreateAnimalPoints").GetComponent <LineLevelManager>();
     }
     controller = GetComponent <CharacterController>();
     if (levelManager != null)
     {
         health = 200 * healthRatio + levelManager.getLevel() * 20 * healthRatio;
     }
     else
     {
         health = 200;
     }
     targetPosition = new Vector3(0, 0, 0);
 }
示例#2
0
 // Use this for initialization
 private void Start()
 {
     audioSource = GetComponent <AudioSource>();
     try
     {
         levelManager = GameObject.Find("CreateAnimalPoints").GetComponent <LevelManager>();
     }
     catch
     {
         linelevelManager = GameObject.Find("LineCreateAnimalPoints").GetComponent <LineLevelManager>();
     }
     controller     = GetComponent <CharacterController>();
     health         = 200;
     targetPosition = new Vector3(0, 0, 0);
 }
示例#3
0
    // Use this for initialization
    private void Start()
    {
        anim = GetComponent <Animator>();

        audioSource = GetComponent <AudioSource>();
        try
        {
            levelManager = GameObject.Find("CreateAnimalPoints").GetComponent <LevelManager>();
            gameResult   = null;
        }
        catch
        {
            linelevelManager = GameObject.Find("LineCreateAnimalPoints").GetComponent <LineLevelManager>();
            gameResult       = GameObject.Find("UIControl/otherShow/GameResult").GetComponent <GameResult>();
        }
        controller     = GetComponent <CharacterController>();
        health         = 20000;
        targetPosition = new Vector3(0, 0, 0);
    }