Exemplo n.º 1
0
        // Update is called once per frame
        protected new void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit) && sceneController.isOver == 0)
                {
                    Debug.Log("click");
                    if (hit.transform.tag == "Priest" || hit.transform.tag == "Devil")
                    {
                        if (sceneController.passenger [0] == hit.collider.gameObject ||
                            sceneController.passenger [1] == hit.collider.gameObject)
                        {
                            offBoatB = CCOffBoat.GetSSAction();
                            this.RunAction(hit.collider.gameObject, offBoatB, this);
                        }
                        else
                        {
                            onBoatA = CCOnBoat.GetSSAction();
                            this.RunAction(hit.collider.gameObject, onBoatA, this);
                        }
                    }
                    else if (hit.transform.tag == "Boat")
                    {
                        moveBoatC = CCMoveBoat.GetSSAction();
                        this.RunAction(hit.collider.gameObject, moveBoatC, this);
                    }
                }
            }

            base.Update();
        }
Exemplo n.º 2
0
        public static CCOffBoat GetSSAction()
        {
            CCOffBoat action = ScriptableObject.CreateInstance <CCOffBoat> ();

            return(action);
        }