コード例 #1
0
ファイル: BuildingLauncher.cs プロジェクト: kalinarm/LD38
        void LaunchProjectil(Projectile prefab, BloodPart target)
        {
            Projectile p = GameObject.Instantiate(prefab);

            p.Part = target;
            p.transform.position = lauchMissilePos.position;
            target.markAsSelected(Color.cyan);
        }
コード例 #2
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                App.Instance.gameView.IsPausing = !App.Instance.gameView.IsPausing;
            }
            if (isPausing)
            {
                return;
            }

            scores.update(Time.deltaTime);
            if (Input.GetMouseButtonDown(0))
            {
                RaycastHit hit;
                Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray, out hit, 100f, maskBloodPart))
                {
                    BloodPart p = hit.collider.GetComponent <BloodPart>();
                    if (p != null)
                    {
                        if (p.data.infected)
                        {
                            config.onCellSelected.activate(p.transform.position);
                        }
                        else
                        {
                            config.onCellSelectedNotInfected.activate(p.transform.position);
                        }
                        onClickOnBloodPart(p);
                    }
                }
            }

            captureAbilityPress(KeyCode.Alpha1, 0);
            captureAbilityPress(KeyCode.Alpha2, 1);
            captureAbilityPress(KeyCode.Alpha3, 2);
            captureAbilityPress(KeyCode.Alpha4, 3);

            if (waitingsParts.Count > 0 && getRobotsAvailablesCount() > 0)
            {
                BloodPart p = waitingsParts.Peek();
                if (p != null)
                {
                    if (robotsManager.affectRobotToCollect(p))
                    {
                        p.markAsSelected(config.colorSelected);
                        waitingsParts.Dequeue();
                    }
                }
            }
        }
コード例 #3
0
        public void onClickOnBloodPart(BloodPart p)
        {
            if (p.isMarked)
            {
                return;
            }

            /*if (robotsManager.affectRobotToCollect(p)) {
             *      p.markAsSelected(config.colorSelected);
             *      config.onCellSelected.activate(p.transform.position);
             * }else {*/
            waitingsParts.Enqueue(p);
            p.markAsSelected(config.colorFuture);
            config.onCellSelectedWaiting.activate(p.transform.position);
            //}
        }