Inheritance: MonoBehaviour
示例#1
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("start Start");

        // input
        GameObject   inputgo  = new GameObject("inputManager");
        inputManager inputmgr = inputgo.AddComponent <inputManager>();

        inputmgr.Init();
        GameObject.DontDestroyOnLoad(inputgo);

        // ui
        GameObject uigo  = new GameObject("uiManager");
        uiManager  uimgr = uigo.AddComponent <uiManager>();

        uimgr.Init();
        GameObject.DontDestroyOnLoad(uigo);

        // lua
        GameObject go     = new GameObject("luaManager");
        luaManager luamgr = go.AddComponent <luaManager>();

        luamgr.Init();
        GameObject.DontDestroyOnLoad(go);
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
 void Start()
 {
     GameObject gameController = GameObject.Find ("gameController");
     iManager = gameController.GetComponent<inputManager> ();
     database = GameObject.Find ("stats").GetComponent<statsManager> ();
     myPlayer = iManager.getMyPlayer ();
 }
示例#4
0
 // Update is called once per frame
 void Update()
 {
     if (!_manager)
     {
         _manager = FindObjectOfType <inputManager>();
     }
 }
示例#5
0
 // Use this for initialization
 void Start()
 {
     IM = GameObject.FindObjectOfType <inputManager>();
     IM.UIelements.SetActive(false);
     IM.InventoryElements.SetActive(false);
     IM.InventoryButton.SetActive(false);
     EndAnim.SetActive(true);
 }
    // Use this for initialization
    void Start()
    {
        FireClose = GameObject.FindGameObjectWithTag("OseSpecial").gameObject.GetComponent <SpriteRenderer>().sprite;
        //FireOpen = transform.FindDeepChild("Takka").gameObject.GetComponent<SpriteRenderer>().sprite;

        Pianokey.SetActive(false);
        IM = GameObject.FindObjectOfType <inputManager>();
    }
示例#7
0
 //Methods
 private void Start()
 {
     boardManager     = this.gameObject.GetComponent <boardManager>();
     inputManager     = this.gameObject.AddComponent <inputManager>();
     animationManager = this.gameObject.AddComponent <animationManager>();
     animationManager.GemFallingSpeed = boardManager.board.gemFallingSpeed;
     inputManager.AnimationManager    = animationManager;
 }
示例#8
0
 private void ConfigureComponents()
 {
     boardManager     = this.gameObject.GetComponent <boardManager>();
     inputManager     = this.gameObject.AddComponent <inputManager>();
     animationManager = this.gameObject.AddComponent <animationManager>();
     animationManager.GemFallingSpeed = boardManager.board.gemFallingSpeed;
     inputManager.AnimationManager    = animationManager;
     countDownScript = GameObject.FindGameObjectWithTag("CountDownText").GetComponent <CountDownScript>();
 }
示例#9
0
    void Awake()
    {
        if (instance != null)
        {
            return;
        }

        instance = this;
    }
    private void getObjects()
    {
        IM            = GetComponent <inputManager>();
        rigidbody     = GetComponent <Rigidbody>();
        audio         = GetComponent <engineAudio>();
        wheelsmanager = GetComponent <wheelsManager>();
        //charAnim = GameObject.FindGameObjectWithTag("char").GetComponent<Animator>();
        wheels    = wheelsmanager.wheels;
        wheelSlip = new float[wheels.Length];
        rigidbody.centerOfMass = gameObject.transform.Find("centerOfMas").gameObject.transform.localPosition;

        audio.maxRPM = maxRPM;
    }
示例#11
0
 void Awake()
 {
     //singleton
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
示例#12
0
    //public List<string> paintingsNames;
    //public int paintingNumber;
    //public int paintingNumberNew;

    void Start()
    {
        //itemsPaintings.AddRange(GameObject.FindGameObjectsWithTag("Paintings"));
        //paintingsTransforms.AddRange(GameObject.FindGameObjectsWithTag("PaintingsPosition"));
        //foreach (GameObject g in paintingsTransforms) {
        //    if(paintingNumber > 0) {
        //        paintingsNames.Add("Painting #" + (paintingNumber));
        //        paintingNumber -= 1;
        //    } else {
        //        break;
        //    }
        //}
        IM = GameObject.FindObjectOfType <inputManager>();
    }
示例#13
0
    // Use this for initialization
    void Start()
    {
        im = gameObject.GetComponent <inputManager>();

        mainCamera = Camera.main;

        forward   = new Vector3(mainCamera.transform.forward.x, mainCamera.transform.forward.y, mainCamera.transform.forward.z);
        forward.y = 0;
        forward.Normalize();



        right = mainCamera.transform.right;
        right.Normalize();
    }
示例#14
0
    void Start()
    {
        // This part is necessary for any spawned prefab
        // This will change to "gameController(Clone)" if we decide to instantiate the gameController
        GameObject gameController = GameObject.Find ("gameController");
        iManager = gameController.GetComponent<inputManager> ();
        tManager = gameController.GetComponent<turnManager> ();
        SS = gameController.GetComponent<functionManager> ();
        dataBase = gameController.GetComponent<statsManager> ();

        myPlayer = this.gameObject;
        time=-1;
        turn=0;
        //actStack = new LinkedList<action>();
    }
    void initPlayer()
    {
        // This part is necessary for any spawned prefab
        // This will change to "gameController(Clone)" if we decide to instantiate the gameController
        GameObject gameController = GameObject.Find ("gameController");
        iManager = gameController.GetComponent<inputManager> ();
        tManager = gameController.GetComponent<turnManager> ();
        SS = gameController.GetComponent<functionManager> ();
        database = GameObject.Find ("stats").GetComponent<statsManager> ();

        myPlayer = this.gameObject;

        energy = database.playerStartEnergy;
        exp.Add("momentum",0);
        exp.Add("explosive",0);
        exp.Add("particle",0);
        exp.Add("field",0);

        hasTech.Add("momentum",true);
        hasTech.Add("explosive",true);
        hasTech.Add("particle",false);
        hasTech.Add("field",false);

        techPanel.Add("momentum",GameObject.Find("momentumPanel"));
        techPanel.Add("explosive",GameObject.Find("explosivePanel"));
        techPanel.Add("particle",GameObject.Find("particlePanel"));
        techPanel.Add("field",GameObject.Find("fieldPanel"));

        time = -1;
        turn = 0;
        waitCount = 0;
        // This is not a permanent solution
        // But it sure ensure that all movements (espeacially ones involving collisions)
        // are done in a stepTime
        speed = 3 / database.stepTime;
        // Temp

        photonView = PhotonView.Get (this);

        // You have to add it as a component for the Update and Start methods to run
        // Pretty disturbing if you think about it...
        // All players start with blaster
        //print ("typeof:" + currWeapon.GetType().ToString ());
        //distinguishes which player is to be controlled
        if (photonView.isMine) {
            iManager.setMyPlayer (this);
            playerIndex = 0;
            playerMenu = GameObject.Find("currentWeaponMenu").GetComponent<playerWpnMenu>();
            playerMenu.setMyPlayer(this);
            // Add blaster as starting weapon
            addWeapon (0);
            setWeapon (0);
            GameObject.Find ("player1Energy").GetComponent<Text> ().text = PhotonNetwork.player.name + ": " +
                                this.energy.ToString ();
            GameObject.Find("Main Camera").GetComponent<cameraMovement>().setPlayer(this.gameObject);
        } else {
            playerIndex = 1;
            // The other player gets a different database for its set of weapons (they are different instances)
            database = Instantiate(database);
            playerMenu = GameObject.Find("oppoentWeaponMenu").GetComponent<playerWpnMenu>();
            playerMenu.setMyPlayer(this);
            GameObject.Find ("player2Energy").GetComponent<Text>().text = PhotonNetwork.otherPlayers[0].name + ": " +
                                this.energy.ToString();
        }
    }
 void Start()
 {
     buildBtn = this.gameObject.GetComponentInChildren<Button> ();
     database = GameObject.Find ("stats").GetComponent<statsManager> ();
     iManager = GameObject.Find ("gameController").GetComponent<inputManager> ();
 }
 //do lights in here
 private void Start()
 {
     if(gameObject.tag == "AI")return;
     controller = GetComponent<controller>();
     IM = GetComponent<inputManager>();
 }
示例#18
0
 private void Awake()
 {
     _in       = GetComponent <inputManager>();
     dashTimer = 0f;
 }
 void Start()
 {
     IM           = GameObject.FindObjectOfType <inputManager>();
     cursorNormal = IM.cursNormal;
 }
示例#20
0
    void Start()
    {
        // This part is necessary for any spawned prefab
        // This will change to "gameController(Clone)" if we decide to instantiate the gameController
        GameObject gameController = GameObject.Find ("gameController");
        iManager = gameController.GetComponent<inputManager> ();
        //tManager = gameController.GetComponent<turnManager> ();
        SS = gameController.GetComponent<functionManager> ();
        dataBase = gameController.GetComponent<statsManager> ();

        rend = GetComponent<Renderer>();
    }
示例#21
0
 // Use this for initialization
 void Awake()
 {
     //sloppy
     instance    = this;
     playerArray = new List <Monkey> ();
 }
 void Start()
 {
     inputM           = GetComponent <inputManager>();
     SidewaysFriction = ForwardFriction = Friction;
     findComponents();
 }
示例#23
0
 // Use this for initialization
 void Start()
 {
     IM = FindObjectOfType <inputManager>();
 }
示例#24
0
 // Use this for initialization
 void Start()
 {
     playerNav = GameObject.Find("Protoplayer").GetComponent <NavMeshAgent>();
     IM        = GameObject.FindObjectOfType <inputManager>();
 }
    void Start()
    {
        photonView = GetComponent<PhotonView> ();

        // This part is necessary for any spawned prefab
        // This will change to "gameController(Clone)" if we decide to instantiate the gameController
        GameObject gameController = GameObject.Find ("gameController");
        iManager = gameController.GetComponent<inputManager> ();
        tManager = gameController.GetComponent<turnManager> ();
        SS = gameController.GetComponent<functionManager> ();
        //dataBase = gameController.GetComponent<statsManager> ();

        // Photon stuff
        PhotonNetwork.logLevel = PhotonLogLevel.Full;
        PhotonNetwork.ConnectUsingSettings ("0.2");
        StartCoroutine ("UpdateConnectionString");
        PhotonNetwork.autoJoinLobby = true;
    }
示例#26
0
 // Use this for initialization
 void Start()
 {
     IM = GameObject.FindObjectOfType <inputManager>();
     GlobeNote.SetActive(false);
 }
 void Start()
 {
     // This part is necessary for any spawned prefab
     // This will change to "gameController(Clone)" if we decide to instantiate the gameController
     GameObject gameController = GameObject.Find ("gameController");
     iManager = gameController.GetComponent<inputManager> ();
     time = -1;
     turn = 0;
     clockCoroutine = clock ();
     // A test of one of the most complicated situations
     /*
     Vector2[] testEndPos = new Vector2[2];
     Vector2[] testV = new Vector2[2];
     testEndPos[0] = new Vector2(0,0);
     testEndPos[1] = new Vector2(0,0);
     testV[0] = new Vector2(1,0);
     testV[1] = new Vector2(0,1);
     List<Vector2>[] result = new List<Vector2>[2];
     result = calculateCollision(testEndPos,testV);
     for (int i=0; i<2; i++) {
         print ("Player"+i.ToString());
         for (int j=0;j<result[i].Count;j++){
             print (result[i][j]);
         }
     }
     */
 }