コード例 #1
0
 void Awake()
 {
     camera   = GetComponent <Camera>();
     material = GetComponentInChildren <Renderer>().sharedMaterial;
     instance = this;
     StartCoroutine(fadeIn());
 }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: jaburns/ggj2018
    void Update()
    {
        while (AllCells.Remove(null))
        {
        }

        if (AllCells.Count < 1)
        {
            FadeCameraController.Lose();
            Destroy(this);
            return;
        }

        var mousePos = getMouseWorldPos();

        if (Input.GetMouseButtonDown(0))
        {
            cachedSelection.Clear();
            if (Input.GetKey(KeyCode.LeftShift))
            {
                cachedSelection.AddRange(selectedCells);
            }

            selectoid    = (Instantiate(selectoidPrefab, null) as GameObject).GetComponent <SelectoidController>();
            selectionPtA = mousePos;
        }

        if (Input.GetMouseButton(0))
        {
            selectionPtB = mousePos;
            selectoid.transform.position = (selectionPtA + selectionPtB) / 2f;
            selectoid.SetSize((selectionPtB - selectionPtA).Abs());

            updateSelection();
        }

        if (Input.GetMouseButtonUp(0))
        {
            Destroy(selectoid.gameObject);
            selectoid = null;
        }

        if (shouldUpdateSelectedCells || Input.GetMouseButtonDown(1))
        {
            shouldUpdateSelectedCells = false;
            updateAttractionListInAllCells();
        }

        if (Input.GetMouseButton(1))
        {
            updateSeekPointInSelectedCells(mousePos);
        }

        if (Input.GetKey(KeyCode.Space))
        {
            ApoptosisSelection();
        }

        updateCameraPosition();
    }
コード例 #3
0
 public void GetRekt()
 {
     Audio.Play("Success");
     Destroy(gameObject);
     FadeCameraController.Win();
 }