public static GetOnBoatAndShore GetSSAction(GameObject role) { GetOnBoatAndShore action = ScriptableObject.CreateInstance <GetOnBoatAndShore>(); action.role = role; return(action); }
protected new void Update() { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (hit.transform.tag == "Devil" || hit.transform.tag == "Priest") { role = GetOnBoatAndShore.GetSSAction(hit.collider.gameObject); this.RunAction(hit.collider.gameObject, role, this); } else if (hit.transform.tag == "Boat") { boat = CCMoveToAction.GetSSAction(); this.RunAction(hit.collider.gameObject, boat, this); } } } base.Update(); //foreach(KeyValuePair<int,GameObject> obj in sceneController.getShoreLeft()) }