コード例 #1
0
    void Start()
    {
        //////////WEISSE MASKE START/////////////////

        whiteMaskGUI.gameObject.SetActive(true);
        orangeMaskGUI.gameObject.SetActive(false);
        redMaskGUI.gameObject.SetActive(false);
        yellowMaskGUI.gameObject.SetActive(false);

        /////////////////////////////////////////////

        if (modelGO == null)
            modelGO = transform.FindChild (transform.name + "_model").gameObject;
        animPlayer = modelGO.GetComponent<Animator> ();
        cc = GetComponent<CharacterController>();
        if(cc==null) {Debug.LogError("Missing CharacterController!!!!");enabled=false;return;}
        hc = GetComponent<HealthController> ();
        if(hc==null) {Debug.LogError("Missing HealthController!!!!");enabled=false;return;}
        maskLight = GetComponentInChildren<MaskLight> ();
        if(maskLight==null) {Debug.LogError("Missing MaskLight!!!!");enabled=false;return;}

        masksFound = new bool[] { true, true, true, true}; 	// initiieren des Masken Arrays
        maskLight.myCharacter = this;

        hc.RepeatHealthReg();
    }