示例#1
0
    void Awake()
    {
        gameEnder              = goMenu.GetComponent <GameOver>();
        anim                   = GetComponent <Animator>();
        travellerMovement      = GetComponent <travellerMovement>();
        currentHealth          = startingHealth;
        takeStationary         = transform.Find("Audio Source").transform.GetComponent <AudioSource>();
        takeStationary.enabled = true;
        cloak                  = transform.Find("traveler").transform.Find("model:geo")
                                 .transform.Find("model:dress_GEO").GetComponentInChildren <SkinnedMeshRenderer>().material;
        hood = transform.Find("traveler").transform.Find("model:geo")
               .transform.Find("model:hoodie_GEO").GetComponentInChildren <SkinnedMeshRenderer>().material;
        l_ear = transform.Find("traveler").transform.Find("model:geo")
                .transform.Find("model:ear_L_GEO").GetComponentInChildren <SkinnedMeshRenderer>().material;
        r_ear = transform.Find("traveler").transform.Find("model:geo")
                .transform.Find("model:ear_R_GEO").GetComponentInChildren <SkinnedMeshRenderer>().material;
        //cloak = GetComponent<MeshRenderer>().material;
        lightValue      = 0.005f;
        orig_lightValue = 0.005f;
        cloak.SetColor("_EmissionColor", new Color(255f, 255f, 255f, 1.0f) * lightValue);
        //Debug.Log("cloak: " + cloak);

        healingParticleSystem = healingVFX.GetComponent <ParticleSystem>();
        if (healingParticleSystem == null)
        {
            Debug.Log("could not find healtheffect");
        }
    }
示例#2
0
    public void setTravelIcon(GameObject lamp)
    {
        GameObject trav = GameObject.FindGameObjectWithTag("Traveller");

        if (trav == null)
        {
            Debug.Log("Could not find traveller");
        }
        travellerMovement tScript = trav.GetComponent <travellerMovement>();

        if (tScript == null)
        {
            Debug.Log("could not find travellerscript");
        }



        if (tScript.currentLight == null)
        {
            if (checkAdjacent(tScript.startAdjacent, lamp))
            {
                lureImage.sprite  = travellerLureIcon;
                lureImage.enabled = true;
            }
            else
            {
                lureImage.enabled = false;
            }
        }

        else
        {
            GameObject            travLamp    = tScript.currentLight;
            lightSourceController lController = travLamp.GetComponent <lightSourceController>();
            if (lController == null)
            {
                Debug.Log("Could not find the lights controller script");
            }

            if (checkAdjacent(lController.adjacentSources, lamp))
            {
                lureImage.sprite  = travellerLureIcon;
                lureImage.enabled = true;
            }
            else
            {
                lureImage.enabled = false;
            }
        }
    }
    void Awake()
    {
        iScript = GetComponentInChildren <InteractionControllerCopy>();

        equippedLight    = 1;
        restrictMovement = false;
        tMovement        = traveller.GetComponent <travellerMovement>();
        if (tMovement == null)
        {
            Debug.Log("Could not find tscript");
        }

        abilityUIScript = lightAbility.GetComponent <abilityIconController>();
        if (abilityUIScript == null)
        {
            Debug.Log("Could not find abilityUIscript");
        }
    }
    private void Awake()
    {
        roamingSound         = transform.Find("Audio Source").transform.GetComponent <AudioSource>();
        attackSound          = transform.Find("Audio Source (1)").transform.GetComponent <AudioSource>();
        attackSound.enabled  = false;
        roamingSound.enabled = false;
        moving        = false;
        traveller     = GameObject.FindGameObjectsWithTag("Traveller")[0].transform;
        tHealth       = traveller.GetComponent <travellerHealth>();
        tMovement     = traveller.GetComponent <travellerMovement>();
        nav           = GetComponent <NavMeshAgent>();
        monsterAnim   = GetComponent <Animator>();
        col           = GetComponent <SphereCollider>();
        currentTarget = transform.position;
        timer         = 0f;
        soundTimer    = 0f;
        upward.Set(0f, 0.2f, 0f);
        lamps = GameObject.FindGameObjectsWithTag("LampLight");
        List <GameObject> validLamps = new List <GameObject>();

        foreach (GameObject lamp in setRoaminglamps)
        {
            lampQueue.Enqueue(lamp);
        }

        bodyAnim = monsterGeo.GetComponent <Animator>();
        if (bodyAnim == null)
        {
            Debug.Log("Could not find the bodyanim");
        }

        currentAttackCooldown = 0;
        isStunned             = false;
        isDistracted          = false;
        currentLamp           = findCurrentLamp();
        //Debug.Log(currentLamp);
        targetLamp = findCurrentLamp();

        attackInterrupt = false;
        isChaseTrav     = false;
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        switcherScript = GetComponentInChildren <lantern_01_matswitcher>();

        if (switcherScript == null)
        {
            Debug.Log("SwitcherScript is ull");
        }
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        pScript = player.GetComponent <playerControllerCopy>();

        GameObject traveller = GameObject.FindGameObjectWithTag("Traveller");

        tMovement = traveller.GetComponent <travellerMovement>();


        if (pScript == null)
        {
            Debug.Log("pScript is nnull");
        }

        lampLight = GetComponentInChildren <Light>();
        if (lampLight == null)
        {
            Debug.Log("Could not find light in child!");
        }

        mfController = GetComponentInChildren <monsterFireController>();
        if (mfController == null)
        {
            Debug.Log("Could not find monsterfire effect controoller");
        }

        //startIntensity = lampLight.intensity;
    }