Пример #1
0
    void InitialPanel()
    {
        currentState  = GameState.Begin;
        lengthText    = GameObject.Find("Length").GetComponent <Text>();
        scoreText     = GameObject.Find("Score").GetComponent <Text>();
        timerText     = GameObject.Find("Time").GetComponent <Text>();
        catMovement   = GameObject.Find("CatIcon").GetComponent <CatMovement>();
        anim          = GameObject.Find("Effector").GetComponent <Animator>();
        gameOverPanel = GameObject.Find("GameOverPanel");
        play          = GameObject.Find("Play").GetComponent <Button>();
        nextLevel     = GameObject.Find("NextLevel").GetComponent <Button>();
        levelSelect   = GameObject.Find("LevelSelect").GetComponent <Button>();
        currentScore  = GameObject.Find("CurrentScore").GetComponent <Text>();
        thunderButton = GameObject.Find("ThunderButton").GetComponent <Button>();
        snowButton    = GameObject.Find("SnowButton").GetComponent <Button>();
        Coins         = GameObject.FindGameObjectsWithTag("Coin");

        thunderButton.gameObject.SetActive(false);
        snowButton.gameObject.SetActive(false);
        gameOverPanel.SetActive(false);

        play.onClick.AddListener(() => Play());
        nextLevel.onClick.AddListener(() => NextLevel());
        levelSelect.onClick.AddListener(() => BackToMenu());
        thunderButton.onClick.AddListener(() => useThunder());
        snowButton.onClick.AddListener(() => useSnow());
        isInitialPanelLoaded = true;
        pausePressed         = false;
    }
Пример #2
0
 private void Awake()
 {
     hook         = GameObject.Find("Hook");
     hookHolder   = GameObject.Find("Hook Holder");
     catMovement  = GetComponent <CatMovement>();
     hookingSound = hook.GetComponent <AudioSource>();
 }
Пример #3
0
    void Start()
    {
        _movable   = GetComponent <CatMovement>();
        _character = GetComponent <CatInteraction>();

        _isActive = true;
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        movement = new CatMovement(GetComponent <Rigidbody>(), GetComponent <Animator>(), GetComponent <Transform>(), firePrefab, windPrefab, waterPrefab);
        GameProgress.Progress.ChangeState(new InitialState());

        //TODO: If the catObject is null, assign it to the proper child.
        myMesh   = catObject.GetComponent <SkinnedMeshRenderer>();//this.transform.FindChild("skeleton").transform.GetComponent(SkinnedMeshRenderer);
        progress = 0;
    }
Пример #5
0
    public void Damage()
    {
        Health--;

        if (Health <= 0)
        {
            CatMovement cM = GameObject.Find("Cat").GetComponent <CatMovement>();
            cM.moveSpeed = 0;
            Destroy(gameObject);
            Instantiate(effect, transform.position, Quaternion.identity);
            FindObjectOfType <GameManager>().EndGame();
        }
    }
Пример #6
0

        
Пример #7
0
    void Awake()
    {
        itemcolliders = GetComponentsInChildren <Collider>();
        foreach (Collider itemcollider in itemcolliders)
        {
            itemcollider.isTrigger = true;
        }
        player           = GameObject.FindGameObjectWithTag("Player");
        playerEquipPoint = GameObject.FindGameObjectWithTag("EquipPoint");
        playerLogic      = player.GetComponent <CatMovement>();

        ItemText = GameObject.Find("ItemText").GetComponent <Text>();
        //itemtransform = GetComponent<Transform>();
    }
Пример #8
0
    void Awake()
    {
        // Setting up the references.
        //anim = GetComponent<Animator>();
        //playerAudio = GetComponent<AudioSource>();
        HUD         = GameObject.FindGameObjectWithTag("HUD");
        catMovement = GetComponent <CatMovement>();
        FuelSlider  = HUD.GetComponentInChildren <Slider>();
        NoFuelText  = GameObject.Find("NoFuelText").GetComponent <Text>();
        //playerShooting = GetComponentInChildren<PlayerShooting>();

        // Set the initial health of the player.
        //startingFuel = catMovement.startfuelLevel;
        FuelSlider.maxValue = catMovement.startfuelLevel;
        currentFuel         = catMovement.startfuelLevel;
    }
Пример #9
0
 // Update is called once per frame
 void Update()
 {
     catMovement = gameObject.transform.parent.gameObject.GetComponent <CatMovement>();
     if (Input.GetKey(KeyCode.LeftShift) == true && catMovement.fuelLevel > 0)
     {
         if (jetpackPs[0].isPlaying == false)
         {
             jetpackPs[0].Play();
             jetpackPs[1].Play();
         }
     }
     else
     {
         foreach (ParticleSystem ps in jetpackPs)
         {
             ps.Stop();
         }
     }
     jetPackSound();
 }
Пример #10
0
 public void Start()
 {
     caty = GetComponent <CatMovement>();
 }
Пример #11
0
    // Use this for initialization

    private void Awake()
    {
        catmovement = GameObject.FindGameObjectWithTag("Player").GetComponent <CatMovement>();
    }
 void Awake()
 {
     movement = GetComponent <CatMovement>();
 }
 private void Awake()
 {
     hook        = GameObject.FindGameObjectWithTag("Player").GetComponent <GrapplingHook>();
     catmovement = GameObject.FindGameObjectWithTag("Player").GetComponent <CatMovement>();
 }
    public GameObject ultimateSPObject; // Represents the Ultimate Skill Points Object

    // initialize the GUI skills based on the character class
    void Start()
    {
        SkillSlot1 = GameObject.Find("skillSlotOne");
        SkillSlot2 = GameObject.Find("skillSlotTwo");
        SkillSlot3 = GameObject.Find("skillSlotThree");
        SkillSlot4 = GameObject.Find("skillSlotFour");
        GameObject content = transform.GetChild(0).gameObject;

        /* Initialises and retrieves the Skill Point Display Objects */
        regularSPObject  = GameObject.Find("RegularSkillPoints");
        ultimateSPObject = GameObject.Find("UltimateSkillPoints");

        /* Initialises and retrieves the Character Classes and associated behaviours */
        if (GameObject.Find("TeamSelectionOBJ").GetComponent <teamselectiondata>().playertype == 0)
        {
            catCharObject = GameObject.Find("Cat(Clone)");              // Retrieves the Hunter Class Object
            catChar       = catCharObject.GetComponent <CatMovement>(); // Retrieves the Hunter Class behaviours
        }
        else
        {
            mouseCharObject = GameObject.Find("Mouse(Clone)");
            mouseChar       = mouseCharObject.GetComponent <MouseMovement>();
        }

        // if hunter
        if (GameObject.Find("TeamSelectionOBJ").GetComponent <teamselectiondata>().playertype == 0)
        {
            content.transform.GetChild(1).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/HeightenedSensesIcon");
            content.transform.GetChild(1).transform.GetChild(1).GetComponent <Text>().text = "Heightened Senses - An alert will show when nearby an Explorer. Passive ability.";

            content.transform.GetChild(2).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/LieInWaitIcon");
            content.transform.GetChild(2).transform.GetChild(1).GetComponent <Text>().text = "Lie in Wait - After 3 seconds of not moving or using any abilities, become invisible until your next combat action or ability use. Passive ability.";

            content.transform.GetChild(3).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/FocusIcon");
            content.transform.GetChild(3).transform.GetChild(1).GetComponent <Text>().text = "Focus - After 10 seconds of not attacking, your next attack deals 200% damage. Passive ability.";

            content.transform.GetChild(5).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/LeapIcon");
            content.transform.GetChild(5).transform.GetChild(1).GetComponent <Text>().text = "Leap - A powerful jump that carries you much farther than a normal jump. 5 second cooldown.";

            content.transform.GetChild(6).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/RecoupIcon");
            content.transform.GetChild(6).transform.GetChild(1).GetComponent <Text>().text = "Recoup - Restore 75 health over 10 seconds. 45 second cooldown.";

            content.transform.GetChild(7).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/StalkerIcon");
            content.transform.GetChild(7).transform.GetChild(1).GetComponent <Text>().text = "Stalker - Become invisible and lower the volume of your footsteps for 5 seconds. 20 second cooldown.";

            content.transform.GetChild(9).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/BashIcon");
            content.transform.GetChild(9).transform.GetChild(1).GetComponent <Text>().text = "Bash - Perform a heavy attack a short range in front of you, dealing damage and stunning the target for 3 seconds. 20 second cooldown.";

            content.transform.GetChild(10).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/LassoIcon");
            content.transform.GetChild(10).transform.GetChild(1).GetComponent <Text>().text = "Lasso - Throw out a rope that pulls the first enemy hit to you. 15 second cooldown.";

            content.transform.GetChild(11).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/TrapIcon");
            content.transform.GetChild(11).transform.GetChild(1).GetComponent <Text>().text = "Trap - Lay down a steel trap that lasts 300 seconds that will snare the first enemy that steps on it for 4 seconds. Maximum of 5 traps at once. 10 second cooldown.";

            content.transform.GetChild(13).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/TheHunterIcon");
            content.transform.GetChild(13).transform.GetChild(1).GetComponent <Text>().text = "The Hunter - Channel for 2 seconds, then teleport behind the closest Explorer. 100 second cooldown. ";

            content.transform.GetChild(14).transform.GetChild(0).GetComponent <SkillButton>().SetName("Hunter/RelaodIcon");
            content.transform.GetChild(14).transform.GetChild(1).GetComponent <Text>().text = "Reload - Instantly refreshes all of your other ability cooldowns. 60 second cooldown.";

            /* Sets the number of Skill Points available */

            /* Retrieves the number of each type of Skill Point available */
            this.RegularSP  = catChar.getRegularSP();
            this.UltimateSP = catChar.getUltimateSP();
        }

        // explorer
        else
        {
            content.transform.GetChild(1).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/TagTeamIcon");
            content.transform.GetChild(1).transform.GetChild(1).GetComponent <Text>().text = "Tag Team - Gain 50% bonus movement speed when near another Explorer. Passive ability.";

            content.transform.GetChild(2).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/TreasureHunterIcon");
            content.transform.GetChild(2).transform.GetChild(1).GetComponent <Text>().text = "Treasure Hunter - An alert will show when nearby chests or keys. Passive ability.";

            content.transform.GetChild(3).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/ProblemSolverIcon");
            content.transform.GetChild(3).transform.GetChild(1).GetComponent <Text>().text = "Problem Solver - An alert will show when nearby puzzle rooms. Passive ability.";

            content.transform.GetChild(5).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/SmokescreenIcon");
            content.transform.GetChild(5).transform.GetChild(1).GetComponent <Text>().text = "Smokescreen - Throw down a cloud of smoke, causing you to become invisible for 5 seconds. 30 second cooldown.";

            content.transform.GetChild(6).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/BandageIcon");
            content.transform.GetChild(6).transform.GetChild(1).GetComponent <Text>().text = "Bandage - Restore 40 health over 10 seconds. 45 second cooldown.";

            content.transform.GetChild(7).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/Demolish");
            content.transform.GetChild(7).transform.GetChild(1).GetComponent <Text>().text = "Demolish - An attack in front of the Explorer. Can destroy walls. 30 second cooldown.";

            content.transform.GetChild(9).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/DisengageIcon");
            content.transform.GetChild(9).transform.GetChild(1).GetComponent <Text>().text = "Disengage - Instantly jump a large distance backwards. 20 second cooldown.";

            content.transform.GetChild(10).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/CrippleIcon");
            content.transform.GetChild(10).transform.GetChild(1).GetComponent <Text>().text = "Cripple - Perform an attack that cripples the first target hit, slowing their movement speed by 30% for 3 seconds. 20 second cooldown.";

            content.transform.GetChild(11).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/BrawlerIcon");
            content.transform.GetChild(11).transform.GetChild(1).GetComponent <Text>().text = "Brawler - Your attacks deal 50% extra damage, and you become immune to enemy abilities. Lasts 5 seconds. 45 second cooldown.";

            content.transform.GetChild(13).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/TheHuntedIcon");
            content.transform.GetChild(13).transform.GetChild(1).GetComponent <Text>().text = "The Hunted - Instantly become invisible, gain 50% bonus movement speed, and mute your footsteps completely for 6 seconds. 120 second cooldown.";

            content.transform.GetChild(14).transform.GetChild(0).GetComponent <SkillButton>().SetName("Explorer/SleepDartIcon");
            content.transform.GetChild(14).transform.GetChild(1).GetComponent <Text>().text = "Sleep Dart - Shoot a dart towards target location, putting the first enemy hit to sleep for 5 seconds, rendering them unable to take any action until the sleep wears off or they take damage. 100 second cooldown. ";

            this.RegularSP  = mouseChar.getRegularSP();
            this.UltimateSP = mouseChar.getUltimateSP();
        }

        /* Displays the number of each type of Skill Point available */
        this.regularSPObject.GetComponent <Text>().text  = "Regular Skill Points:  " + this.RegularSP.ToString();   // Displays the number of Regular Skill Points available
        this.ultimateSPObject.GetComponent <Text>().text = "Ultimate Skill Points:  " + this.UltimateSP.ToString(); // Displays the number of Ultimate Skill Points available

        /*
         * NameList.Add("Alan");
         * NameList.Add("Amy");
         * NameList.Add("Brian");
         * NameList.Add("Carrie");
         * NameList.Add("David");
         * NameList.Add("Joe");
         * NameList.Add("Jason");
         * NameList.Add("Michelle");
         * NameList.Add("Stephanie");
         * NameList.Add("Zoe");
         *
         * foreach(string str in NameList)
         * {
         * GameObject go = Instantiate(Button_Template) as GameObject;
         * go.SetActive(true);
         * SkillButton TB = go.transform.GetChild(0).GetComponent<SkillButton>();
         * TB.SetName(str);
         * go.transform.SetParent(Button_Template.transform.parent);
         *
         * }*/
    }