Exemplo n.º 1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
 private void Awake()
 {
     treasureController = TreasureController.Instance;
     _gameManager       = GameManager.Instance;
     _gameManager.OnGameStateChanged.AddListener(OnGameStateChangedHandler);
     //Initializing();
 }
Exemplo n.º 3
0
 private void Awake()
 {
     _gameManager        = GameManager.Instance;
     _playerAction       = PlayerAction.Instance;
     _playerTransport    = PlayerTransport.Instance;
     _switchScene        = SwitchScene.Instance;
     _placesController   = PlacesController.Instance;
     _treasureController = TreasureController.Instance;
     _gameManager.OnGameStateChanged.AddListener(OnGameStateChangedHandler);
     ActiveTrasureAnimation(false);
 }
Exemplo n.º 4
0
    private void Awake()
    {
        _templateController = ItemTemplateController.Instance;
        _treasureController = TreasureController.Instance;
        _playerAction       = PlayerAction.Instance;
        _switchScene        = SwitchScene.Instance;
        _itemsReceive       = new Stack <ItemPickUp>();
        _currentSpawnItems  = new List <SpawnItem>();

        ActiveReceiveCanvas(false);
        _itemTemp = _itemPrefab;
    }
Exemplo n.º 5
0
 // OnTriggerEnter2D is inconsistent, so we use ontriggerstay
 void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.tag == "Exit")
     {
         standingOnExit = true;
     }
     else if (other.gameObject.tag == "Treasure")
     {
         standingOnTreasure = true;
         treasureReference  = other.gameObject.GetComponent <TreasureController>();
     }
 }
Exemplo n.º 6
0
    private void GenerateTreasure()
    {
        int     x   = Random.Range(0, (width / 2)) * 2;
        int     y   = Random.Range(0, (height / 2)) * 2;
        Vector3 pos = new Vector3(x - width / 2f, 1.25f, y - height / 2f);

        if (treasureController == null)
        {
            treasureController = Instantiate(treasure, pos, Quaternion.identity).GetComponent <TreasureController>();
        }
        else
        {
            treasureController.transform.localPosition = pos;
        }
        treasureController.position = pos;
    }
Exemplo n.º 7
0
    bool hit = false;//当たったらtrueに

    // Start is called before the first frame update
    void Start()
    {
        treasureCon = treasureController.GetComponent <TreasureController>();
    }