public GameObject GetArrow()
    {
        if (free.Count == 0)
        {
            arrow = Instantiate(Resources.Load <GameObject>("Prefabs/arrow"));
        }
        else
        {
            arrow = free.Dequeue();
            //the arrow be shot
            if (arrow.tag == "hit")

            {
                arrow.GetComponent <Rigidbody>().isKinematic = false;
                //visible
                arrow.transform.GetChild(0).gameObject.SetActive(true);
                arrow.tag = "arrow";
            }

            arrow.gameObject.SetActive(true);
        }

        sceneControler = (FirstSceneController)SSDirector.GetInstance().CurrentScenceController;
        Transform temp = sceneControler.bow.transform.GetChild(2);


        arrow.transform.position = temp.transform.position;
        arrow.transform.parent   = sceneControler.bow.transform;
        used.Add(arrow);
        return(arrow);
    }
 public void Init()
 {
     mainController      = (FirstController)SSDirector.GetInstance().CurrentSenceController;
     this.leftLandModel  = mainController.leftLandController.GetLandModel();
     this.rightLandModel = mainController.rightLandController.GetLandModel();
     this.boatModel      = mainController.boatController.GetBoatModel();
 }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     mainController       = (FirstController)SSDirector.GetInstance().CurrentSceneController;
     this.leftShoreModel  = mainController.leftShoreController.GetShore();
     this.rightShoreModel = mainController.rightShoreController.GetShore();
     this.boatModel       = mainController.boatController.GetBoatModel();
 }
Exemple #4
0
    public void PlayMusic(AudioClip clip)
    {
        FirstSceneController scene = SSDirector.GetInstance().CurrentScenceController as FirstSceneController;

        //在一个玩家的位置播放音乐
        AudioSource.PlayClipAtPoint(clip, scene.player.transform.position);
    }
Exemple #5
0
    void Shoot()
    {
        FirstSceneController scene = SSDirector.GetInstance().CurrentScenceController as FirstSceneController;

        //在一个玩家的位置播放音乐
        AudioSource.PlayClipAtPoint(shootClip, scene.player.transform.position);
    }
 public void Reset()
 {
     bank_model = (SSDirector.GetInstance().CurrentSceneController as Controller).start_land;
     GoLand(bank_model);
     SetPosition(bank_model.GetEmptyPosition());
     bank_model.AddRole(this);
 }
 void Awake()
 {
     SSDirector.GetInstance().CurrentSenceController = this;
     LoadResources();
     this.gameObject.AddComponent <UserGUI>();
     this.gameObject.AddComponent <CCActionManager>();
     this.gameObject.AddComponent <JudgeController>();
 }
Exemple #8
0
 void Start()
 {
     action = SSDirector.GetInstance().CurrentScenceController as IUserAction;
     text_style.normal.textColor  = new Color(0, 0, 0, 1);
     text_style.fontSize          = 16;
     score_style.normal.textColor = new Color(1, 0, 1, 1);
     score_style.fontSize         = 16;
 }
 public void Reset()
 {
     moveableScript.Reset();
     coastController = (SSDirector.GetInstance().currentSceneController as FirstController).fromCoast;
     GetOnCoast(coastController);
     SetPosition(coastController.GetEmptyPosition());
     coastController.GetOnCoast(this);
 }
Exemple #10
0
    bool gaming = true; //用于判断游戏是否正在进行,由于目前还不存在起始界面,所以一开始游戏就开始了

    void Awake()
    {
        SSDirector director = SSDirector.GetInstance();

        //director.setFPS(60);
        director.CurrentSceneController = this;
        director.CurrentSceneController.LoadResource();
    }
Exemple #11
0
 void Start()
 {
     action = SSDirector.GetInstance().CurrentScenceController as IUserAction;
     style.normal.textColor = Color.black;
     style.fontSize         = 20;
     score_style.fontSize   = 20;
     over_style.fontSize    = 25;
 }
 // Start is called before the first frame update
 void Start()
 {
     action                 = SSDirector.GetInstance().CurrentSceneController as IUserAction;
     textStyle.fontSize     = 16;
     scoreStyle.fontSize    = 16;
     timeStyle.fontSize     = 20;
     gameOverStyle.fontSize = 30;
 }
 void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.tag == "Player")
     {
         FirstController firstController = SSDirector.GetInstance().CurrentScenceController as FirstController;
         firstController.wall_sign = sign;
     }
 }
Exemple #14
0
 void Start()
 {
     SSDirector.GetInstance().CurrentSceneController = this;
     diskFactory   = Singleton <DiskFactory> .Instance;
     scoreRecorder = Singleton <ScoreRecorder> .Instance;
     gameObject.AddComponent <FlyActionManager>();
     gameObject.AddComponent <UserGUI>();
 }
Exemple #15
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.name == "Player(Clone)")
     {
         sceneController           = (Controller)SSDirector.GetInstance().CurrentSceneController;
         sceneController.wall_sign = sign;
     }
 }
Exemple #16
0
    void Start()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentScenceController = this;
        gui = gameObject.AddComponent <UserGUI>() as UserGUI;
        LoadResources();
    }
Exemple #17
0
    public void Start()
    {
        SSDirector director = SSDirector.GetInstance();

        director.genGameObjects = this;
        LoadResources();
        boat_capacity = 2;
    }
 public override void Start()
 {
     this.gameobject.GetComponent <Animator>().SetBool("run", true);
     data            = this.gameobject.GetComponent <PatrolData>();
     sceneController = SSDirector.GetInstance().currentSceneController as FirstController;
     enable          = true;
     handle          = false;
 }
Exemple #19
0
 public float m_TurnSpeed = 180f;            // 坦克转弯速度
 void Awake()
 {
     director = SSDirector.GetInstance();
     director.CurrentSceneController = this;
     director.CurrentSceneController.LoadResources();
     actionManager = GetComponent <CCActionManager>();
     m_Rigidbody   = player.GetComponent <Rigidbody>();
 }
    // the first scripts
    void Awake()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentSceneController = this;
        director.CurrentSceneController.LoadResources();
        usergui = gameObject.AddComponent <UserGUI>() as UserGUI;
    }
 // Use this for initialization
 protected void Start()
 {
     SceneController = (FirstController)SSDirector.GetInstance().CurrentSceneController;
     foreach (GameObject i in SceneController.Patrols)
     {
         action = PatrolAction.GetSSAction();
         this.RunAction(i, action, this);
     }
 }
Exemple #22
0
    // Use this for initialization
    void Awake()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentSceneController = this;
        Factory        = Singleton <GameFactory> .Instance;
        action_manager = gameObject.AddComponent <PatrolActionManager>() as PatrolActionManager;
        LoadResources();
    }
Exemple #23
0
 void Start()
 {
     SSDirector.GetInstance().CurrentScenceController = this;
     gameObject.AddComponent <UserGUI>();
     gameObject.AddComponent <ScoreRecorder>();
     gameObject.AddComponent <PatrolFactory>();
     gameObject.AddComponent <PatrolActionManager>();
     LoadResources();
 }
    void Start()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentScenceController = this;
        disk_factory   = Singleton <DiskFactory> .Instance;
        action_manager = gameObject.AddComponent <FlyActionManager>() as FlyActionManager;
        user_gui       = gameObject.AddComponent <UserGUI>() as UserGUI;
    }
Exemple #25
0
    void Start()
    {
        action = SSDirector.GetInstance().CurrentScenceController as IUserAction;

        header_style          = new GUIStyle();
        header_style.fontSize = 40;
        text_style            = new GUIStyle();
        text_style.fontSize   = 20;
    }
Exemple #26
0
    void Start()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentScenceController = this;
        judgement      = Singleton <CCJudgement> .Instance;
        action_manager = gameObject.AddComponent <PhysisActionManager>() as IActionManager;
        user_gui       = gameObject.AddComponent <UserGUI>() as UserGUI;
        count          = 0;
    }
Exemple #27
0
        void Start()
        {
            SSDirector director = SSDirector.GetInstance();

            director.CurrentScenceController = this;
            gui = gameObject.AddComponent <UserGUI>() as UserGUI;
            LoadResources();
            manager = gameObject.AddComponent <MyActionManager>() as MyActionManager;
            judge   = new Judge(start_land, end_land, boat);
        }
Exemple #28
0
    void Start()
    {
        SSDirector director = SSDirector.GetInstance();

        director.currentSceneController = this;
        factory       = Singleton <PatroFactory> .GetInstance;
        actionManager = gameObject.AddComponent <PatrolActionManager> () as PatrolActionManager;
        LoadResources();
        recorder = Singleton <ScoreRecorder> .GetInstance;
    }
Exemple #29
0
 void Start()
 {
     action = SSDirector.GetInstance().CurrentScenceController as IUserAction;
     text_style.normal.textColor  = new Color(0, 0, 0, 1);
     text_style.fontSize          = 16;
     score_style.normal.textColor = new Color(1, 0.92f, 0.016f, 1);
     score_style.fontSize         = 16;
     over_style.fontSize          = 25;
     StartCoroutine(ShowTip());
 }
Exemple #30
0
    public MySceneActionManager actionManager;   //动作管理

    void Start()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentScenceController = this;
        user_gui = gameObject.AddComponent <UserGUI>() as UserGUI;
        LoadResources();

        actionManager = gameObject.AddComponent <MySceneActionManager>() as MySceneActionManager;
    }