Example #1
0
 private void Start()
 {
     GameContrl    = GameObject.FindWithTag("EditorOnly").GetComponent <Gamecontroller>();
     _time         = 3.03f;
     _anim         = transform.GetComponent <Animator>();
     _anim.enabled = false;
 }
Example #2
0
 void Start()
 {
     inv = GameObject.FindGameObjectWithTag("GameController").GetComponent <InventoryDatabase>();
     //itemDatabase = GameObject.FindGameObjectWithTag ("GameController").GetComponent<ItemDatabase>();
     control   = GameObject.FindGameObjectWithTag("GameController").GetComponent <Gamecontroller>();
     desc_Menu = Resources.Load <GameObject>("Prefab/Menu_Description");
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     controll = GameObject.FindGameObjectWithTag("GameController").GetComponent <Gamecontroller>();
     //button = GetComponent<Button>();
     //button.onClick.AddListener(TaskOnClick);
     agent = GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>();
 }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        source         = GetComponent <CriAtomSource>();
        _gururinRb2d   = GameObject.Find("Gururin").GetComponent <Rigidbody2D>();
        playerMove     = GameObject.Find("Gururin").GetComponent <PlayerMove>();
        gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();
        flagManager    = GameObject.Find("FlagManager").GetComponent <FlagManager>();

        _gpQuaternion = gearPos.transform.rotation;

        for (int i = 0; i < moveGear.Length; i++)
        {
            moveGear[i] = true;
        }

        //gearCol = gear.GetComponent<PolygonCollider2D>();

        if (GetComponent <GanGanKamen.BossHand>() != null)
        {
            bossHand = GetComponent <GanGanKamen.BossHand>();
        }
        if (GetComponent <GanGanKamen.BossStageGear>() != null)
        {
            stageGear = GetComponent <GanGanKamen.BossStageGear>();
        }
    }
Example #5
0
    // Use this for initialization
    IEnumerator Start()
    {
        inv           = GameObject.FindGameObjectWithTag("GameController").GetComponent <InventoryDatabase>();
        controll      = GameObject.FindGameObjectWithTag("GameController").GetComponent <Gamecontroller>();
        cam           = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        agent         = GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>();
        playerTextRef = Resources.Load <GameObject>("Prefab/Player_Text");
        playerText    = Instantiate(playerTextRef);
        playerText.transform.SetParent(GameObject.FindGameObjectWithTag("Main Canvas").transform, false);
        //playerText.transform.localPosition = new Vector3(0, 200,0);
        playerText.transform.localScale = Vector3.one;

        //StartCoroutine(InputListener());
        agent.autoTraverseOffMeshLink = false;
        while (true)
        {
            if (agent.isOnOffMeshLink)
            {
                if (method == OffMeshLinkMoveMethod.Parabola)
                {
                    yield return(StartCoroutine(Parabola(agent, jumpHeight, jumpDuration)));
                }
                agent.CompleteOffMeshLink();
            }
            yield return(null);
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Example #7
0
    // Start is called before the first frame update
    void Start()
    {
        _source        = GetComponent <CriAtomSource>();
        gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();

        _sourcePlay   = false;
        _sourceVolume = _source.volume;
    }
Example #8
0
 // Start is called before the first frame update
 void Start()
 {
     blocking        = false;
     _pushSE         = GameObject.Find("SE_item(CriAtomSource)").GetComponent <CriAtomSource>();
     _blockSE        = GetComponent <CriAtomSource>();
     _gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();
     _flagManager    = GameObject.Find("FlagManager").GetComponent <FlagManager>();
 }
Example #9
0
 // Start is called before the first frame update
 void Start()
 {
     _rb2d          = GetComponent <Rigidbody2D>();
     playerMove     = GetComponent <PlayerMove>();
     _jumpSE        = GetComponent <CriAtomSource>();
     gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();
     flagManager    = GameObject.Find("FlagManager").GetComponent <FlagManager>();
 }
Example #10
0
 void GameStart()
 {
     if (!tmp[stage])
     {
         tmp[stage] = Instantiate(game[stage]);
         gc         = GameObject.Find("Game0(Clone)").GetComponentInChildren <Gamecontroller>();
     }
 }
Example #11
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Bullet")
     {
         Destroy(gameObject); //ลบตัวเอง
         Gamecontroller.Addscore(scorevalue);
     }
 }
Example #12
0
    private void Start()
    {
        _pushSE         = GameObject.Find("SE_item(CriAtomSource)").GetComponent <CriAtomSource>();
        _gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();
        _pos            = transform.position;

        _eject = false;
    }
Example #13
0
 private void Start()
 {
     canvas2 = GameObject.FindGameObjectWithTag("CanvasS");
     Jo      = 0;
     JOP     = GetComponent <Gamecontroller>();
     // NUMERO = 1;
     Cancel = true;
 }
Example #14
0
 void Start()
 {
     GameContrl       = GameObject.FindWithTag("EditorOnly").GetComponent <Gamecontroller>();
     _time            = 3.03f;
     _anim            = transform.GetComponent <Animator>();
     _anim.enabled    = false;
     _giveWaterToNext = false;
     StartWatering();
 }
Example #15
0
 private void Update()
 {
     if ((gameObject.transform.position.x - Gamecontroller.PlayerTransform.position.x < 30) && !IsFollow)
     {//alem de iniciar a perseguição ao heroi também toca uma udio próprio
         Gamecontroller.PlaySFX(Gamecontroller.SfxBossAwake);
         IsFollow = true;
         Gamecontroller.BossBar.SetActive(true);//ativa a barra de vida especial de chefe
     }
 }
Example #16
0
 void Start()
 {
     control           = GetComponent <Gamecontroller>();
     inventoryPanelRef = Resources.Load <GameObject> ("Prefab/main_inv");
     inventorySlot     = Resources.Load <GameObject> ("Prefab/Slot");
     inventoryItem     = Resources.Load <GameObject> ("Prefab/Item");
     itemDatabase      = GetComponent <ItemDatabase>();
     inventoryData     = JsonMapper.ToObject(File.ReadAllText(Application.dataPath + "/StreamingAssets/Inventorys.json"));
     ConstructInventoryDatabase();
 }
    public void EnemyAtack()
    {//controle do ataque d inimigo
        if ((Gamecontroller.PlayerTransform.position.x - transform.position.x <= 5 && !IsLookLeft) ||
            (transform.position.x - Gamecontroller.PlayerTransform.position.x <= 5 && IsLookLeft))
        {
            Gamecontroller.PlaySFX(Gamecontroller.SfxAtack);
            NpcAnimator.SetTrigger("Atack");

            CanAtack = false;
        }
    }
Example #18
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
     }
 }
Example #19
0
 // Use this for initialization
 void Start()
 {
     hotSpotDatabase = GameObject.FindGameObjectWithTag("GameController").GetComponent <HotspotDatabase> ();
     itemDatabase    = GameObject.FindGameObjectWithTag("GameController").GetComponent <ItemDatabase> ();
     inv             = GameObject.FindGameObjectWithTag("GameController").GetComponent <InventoryDatabase> ();
     controll        = GameObject.FindGameObjectWithTag("GameController").GetComponent <Gamecontroller>();
     hotspot         = hotSpotDatabase.FetchHotspotBySlug(this.gameObject.name);
     hotspotName     = hotspot.Title;
     inventorySlot   = Resources.Load <GameObject> ("Prefab/Slot");
     inventoryItem   = Resources.Load <GameObject> ("Prefab/Item");
 }
Example #20
0
    // Use this for initialization
    void Start()
    {
        agent             = GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>();
        parentHotspotData = GetComponent <HotspotData>();
        controll          = GameObject.FindGameObjectWithTag("GameController").GetComponent <Gamecontroller>();
        database          = GameObject.FindGameObjectWithTag("GameController").GetComponent <EventandTalkDatabase>();
        eventTalk         = database.FetchEventTalkBySlug(parentHotspotData.hotspot.Slug);
        GameObject objFlowchart = GameObject.Find(eventTalk.Flowchart);

        flowchart = objFlowchart.GetComponent <Flowchart>();
    }
Example #21
0
    public void OnMouseDown()
    {
        GameObject     copLights    = GameObject.Find("GameController");
        Gamecontroller targetScript = copLights.GetComponent <Gamecontroller>();

        targetScript.green += 1;
        timer -= Time.deltaTime;
        ScoreG();
        AudioSource.PlayClipAtPoint(clip, transform.position);
        Destroy(gameObject);
    }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Example #23
0
    public void OnMouseDown()
    {
        GameObject     copLights    = GameObject.Find("GameController");
        Gamecontroller targetScript = copLights.GetComponent <Gamecontroller>();

        targetScript.blue      += 1;
        targetScript.timer     += bonustime;
        targetScript.destroyBox = true;
        Score();
        AudioSource.PlayClipAtPoint(clip, transform.position);
        Destroy(gameObject);
    }
Example #24
0
 // Start is called before the first frame update
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMove>();
     gameController  = GameObject.Find("GameController").GetComponent <Gamecontroller>();
     capsuleCollider = GetComponent <CapsuleCollider2D>();
     gearColider     = thisGear.gear.GetComponent <PolygonCollider2D>();
     handParent      = transform.parent.gameObject;
     distinationPos  = new Vector2(Random.Range(moveRangeX.x, moveRangeX.y),
                                   Random.Range(moveRangeY.x, moveRangeY.y));
     pattern  = Pattern.RandomWalk;
     startPos = handParent.transform.position;
 }
Example #25
0
    // Use this for initialization
    void Start()
    {
        gc = GameObject.FindObjectOfType <Gamecontroller>();

        rb = GetComponent <Rigidbody2D>();
        // rb.AddForce(Vector2.down * Speed*Time.deltaTime);
        rb.velocity = Dir * Speed;

        Vector3 tmp = Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 0));

        minY = tmp.y;
    }
Example #26
0
    // Start is called before the first frame update
    void Start()
    {
        source         = GetComponent <CriAtomSource>();
        playerMove     = GameObject.Find("Gururin").GetComponent <PlayerMove>();
        gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();
        flagManager    = GameObject.Find("FlagManager").GetComponent <FlagManager>();
        _gururinRb2d   = GameObject.Find("Gururin").GetComponent <Rigidbody2D>();

        _gpQuaternion = gearPos.transform.rotation;

        moveGear[0] = true;
    }
Example #27
0
    // Start is called before the first frame update
    void Start()
    {
        gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>();

        if (speed == false)
        {
            _rotSpeed = gearGimmick.rotSpeed / 100.0f;
        }
        else
        {
            _rotSpeed = gearGimmick.rotSpeed / -100.0f;
        }
    }
Example #28
0
 // Use this for initialization
 void Awake()
 {
     SceneManager.sceneLoaded += OnSceneLoaded;
     if (control == null)
     {
         DontDestroyOnLoad(gameObject);
         control = this;
     }
     else if (control != this)
     {
         Destroy(gameObject);
     }
 }
Example #29
0
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <Gamecontroller>();
        }
        if (gameController == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
Example #30
0
    private void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <Gamecontroller>();
        }
        if (gameController == null)
        {
            Debug.Log("Nicht da 'Gamecontroller'");
        }
    }