コード例 #1
0
ファイル: enemy.cs プロジェクト: Justobe/Unity_3D-Tank_Battle
 //float time = 10;
 void Start()
 {
     helpGod   = new GameGod();
     player    = GameObject.Find("Tank");
     mybullet  = Resources.Load("mybullet") as GameObject;
     detonator = Resources.Load("explosion") as GameObject;
 }
コード例 #2
0
ファイル: MidSpawner.cs プロジェクト: Nexas/Project-S
    // Update is called once per frame
    void Update()
    {
        camLeft   = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, 0.0f, 100.0f));
        camTop    = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, Screen.height, 100.0f));
        camRight  = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, 0.0f, 100.0f));
        camBottom = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, 0.0f, 100.0f));

        if (camTop.z + 2.0f >= transform.position.z)
        {
            isSpawning = true;
        }

        if (isSpawning)
        {
            transform.Translate(new Vector3(0.0f, 0.0f, 10.0f * Time.deltaTime));

            spawnTimer += Time.deltaTime;

            if (spawnTimer >= spawnOffset && spawnNumber > 0)
            {
                Vector3 spawnPoint = new Vector3(0.0f, 0.0f, 0.0f);
                spawnTimer = 0.0f;
                Transform  t     = Instantiate(obj, transform.position, transform.rotation) as Transform;
                GameObject enemy = GameGod.GetLibraryScript(names, t);
                spawnNumber -= 1;
            }
            else if (spawnNumber <= 0)
            {
                Destroy(this.gameObject);
            }
        }
    }
コード例 #3
0
    private void Start()
    {
        // References.
        _gg = GetComponent <GameGod>();

        // Actions.
        StartRound();
    }
コード例 #4
0
    private void Awake()
    {
        CurrentPoints = 0;
        _instance     = this;
        _started      = false;


        DontDestroyOnLoad(gameObject);
    }
コード例 #5
0
ファイル: Manager.cs プロジェクト: SimonKoeth/PrismWars
    // Use this for initialization
    void Start()
    {
        GG                = this.gameObject.GetComponent <GameGod>();
        Unitlist          = new List <SelectController>();
        GameCamera        = GameObject.Find("Main Camera").GetComponent <Camera>();
        Rendercam.enabled = false;

        TName = UIName.GetComponent <Text>();
        TDesc = UIDescription.GetComponent <Text>();
        THP   = UIhp.GetComponent <Text>();

        HPPercent = UISlider.GetComponent <Slider>();
    }
コード例 #6
0
    private IEnumerator Start()
    {
        _gg            = GameObject.FindGameObjectWithTag("GameGod").GetComponent <GameGod>();
        _currentSpawns = 0;
        _ragePT.SetActive(false);

        while (_currentSpawns < _maxSpawns)
        {
            Spawn();
            _currentSpawns++;
            yield return(new WaitForSeconds(_spawnInterval));
        }
    }
コード例 #7
0
ファイル: Map_Generator.cs プロジェクト: SimonKoeth/PrismWars
    // Use this for initialization
    void Start()
    {
        GG     = GameObject.Find("GameGod").GetComponent <GameGod>();
        turtle = this.gameObject;
        turtle.transform.tag = "turtle";
        Vector3 rot = new Vector3(0f, (float)rotation, 0f);

        turtle.transform.Rotate(rot, Space.Self);
        col             = (BoxCollider)this.gameObject.AddComponent(typeof(BoxCollider));
        rig             = this.gameObject.AddComponent <Rigidbody>();
        rig.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezePositionZ;
        this.gameObject.GetComponent <Rigidbody>().useGravity = false;
        turtle.transform.Translate(1 + 0.1f, 0, 0);
        //Debug.Log("split!");
    }
コード例 #8
0
ファイル: GameGod.cs プロジェクト: madparker/GGJ-2020-Vectory
    public void Awake()
    {
        if (me != null)
        {
            Debug.LogError("TOO MANY GODS THEY MUST FIGHT");
            Destroy(gameObject);
            return;
        }
        me         = this;
        levelArray = new Level[4] {
            new Level1(), new Level2(), new Level3(), new Level4()
        };
        //{ new MoveRightOne(), new MoveDiagonalUpLeft(), new MoveDiagonalUpLeftOnUnit(), new AccelerateRight()};
        //playerRuleArr = new PlayerRule[4]
        //    { new Lv1(), new Lv2(), new Lv3(), new Lv4()};
        InitLevel();

        arrowHead.SetActive(false);
    }
コード例 #9
0
    //public Unit unitprops;

    // Use this for initialization
    void Start()
    {
        updatetime = Random.Range(0f, 1f);
        //test.SetActive(false);

        GG = GameObject.Find("GameGod").GetComponent <GameGod>();
        if (this.gameObject.tag.Equals("Unit"))
        {
            GG.PlayerUnits.Add(this.gameObject); //Add All units to the gamegod to work with
        }
        else if (this.gameObject.tag.Equals("enemy"))
        {
            GG.Enemyunits.Add(this.gameObject);
        }

        manag = GameObject.Find("GameGod").GetComponent <Manager>();
        NMA   = this.gameObject.GetComponent <NavMeshAgent>();
        //selLight = this.gameObject.transform.GetChild(0).GetComponent<Light>();
    }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        Copymat = GetComponent <MeshRenderer>().material;
        mg      = GameObject.Find("GameGod").GetComponent <Manager>();
        GG      = GameObject.Find("GameGod").GetComponent <GameGod>();

        if (this.gameObject.tag.Equals("Building"))
        {
            GG.Playerbuildings.Add(this.gameObject);
        }
        else if (this.gameObject.tag.Equals("enemyBuilding"))
        {
            GG.Enemybuildings.Add(this.gameObject);
        }

        this.hp      = building.hp;
        this.def     = building.def;
        buildTime    = 0;
        maxBuildTime = building.BuildTime;
    }
コード例 #11
0
ファイル: StagePreviewer.cs プロジェクト: CombNITNC/akiha
    void Awake()
    {
        var godObj = GameObject.FindWithTag("God");

        if (godObj != null)
        {
            god = godObj.GetComponent <GameGod>();
        }

        wiper = GetComponent <ScreenWiper>();

        threshold = Screen.width / 2.5f;
        GenerateAnimations();
        if (anims[0] != null)
        {
            anims[0].Play("Preview");
        }

        var saver = GetComponent <GameStorageManager>();

        saver.Load(out scores);
        UpdateLabel();
    }
コード例 #12
0
    public GameObject gunBubbles;     //Particle effect to instantiate

    private void Start()
    {
        _gg = GameObject.FindGameObjectWithTag("GameGod").GetComponent <GameGod>();
    }
コード例 #13
0
    public void SpawnObject(GameObject _objectToSpawn, GameGod gg)
    {
        GameObject spawnedObject = Instantiate(_objectToSpawn, transform.position, transform.rotation);

        spawnedObject.GetComponentInChildren <EnemyController>()._gg = gg;
    }
コード例 #14
0
ファイル: Player.cs プロジェクト: syauqy/marcoplo-blind
	// Use this for initialization
	void Start () {
		game = GameObject.Find("GameGod").GetComponent<GameGod>();
		mouseClickDisable = true;

	
	}
コード例 #15
0
 void SpawnUnit(Vector3 pos)
 {
     Transform  t     = Instantiate(obj, pos, transform.rotation) as Transform;
     GameObject enemy = GameGod.GetLibraryScript(names, t);
 }
コード例 #16
0
 private void Start()
 {
     _currentDoors = new List <GameObject>();
     _gg           = GetComponent <GameGod>();
     StartCoroutine(ActivateNextEvent());
 }
コード例 #17
0
 private void Start()
 {
     GG = GameObject.Find("GameGod").GetComponent <GameGod>();
 }