Beispiel #1
0
 // public GameObject Cam;
 //public GameObject Bgshka;
 void Start()
 {
     BG        = GetComponent <Rigidbody2D>();
     Movingpla = GameObject.Find("kucha");
     script    = Movingpla.GetComponent <MovingPlayer>();
     // BG.transform.position = new Vector3( 0, Cam.transform.position.y, 10);
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     counter    = TimeUntilDeleted;
     rigid      = GetComponent <Rigidbody2D>();
     player     = FindObjectOfType <MovingPlayer>();
     baseDamage = damage;
 }
Beispiel #3
0
 void Start()
 {
     Player     = GameObject.Find("kucha");
     script     = Player.GetComponent <PlayerHP>();
     scriptMove = Player.GetComponent <MovingPlayer>();
     rb         = GetComponent <Rigidbody2D>();
 }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     player  = FindObjectOfType <PlayerInput>().gameObject.transform;
     player2 = FindObjectOfType <MovingPlayer>();
     rigid   = GetComponent <Rigidbody2D>();
     score   = FindObjectOfType <Score>();
     isInvis = false;
 }
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     GetComponent <SpriteRenderer>().color = Color.green;
     player    = FindObjectOfType <MovingPlayer>();
     coll      = GetComponent <BoxCollider2D>();
     baseSpeed = player.speed;
     c         = GetComponent <SpriteRenderer>().color;
 }
Beispiel #6
0
    void Start()
    {
        radius    = spawner.GetComponent <Spawner>();
        mov       = gameObject.GetComponent <MovingPlayer>();
        gameWorld = new List <GameObject>();

        SpawnObject(gameObject.transform.position);
    }
 public override void NetworkStart()
 {
     netptransform = GetComponent <MovingPlayer>();
     if (IsOwner)
     {
         InvokeRepeating("TransmitAnimationStates", 0f, (1f / FixedSendsPerSecond));
     }
 }
Beispiel #8
0
 private void Start()
 {
     gridArray    = _buildPlane.gridArray;
     rows         = _buildPlane.rows;
     columns      = _buildPlane.columns;
     scale        = _buildPlane.scale;
     movingPlayer = _player.GetComponent <MovingPlayer>();
 }
 private void Awake()
 {
     if (Singleton != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Singleton = this;
     }
 }
    void Start()
    {
        Placescript = GameObject.Find("kucha");
        script      = Placescript.GetComponent <SpawnGround>();
        ZombieA     = script.newZombie;
        Trigger     = ZombieA.transform.Find("PlayerTarget").gameObject;
        scriptTrig  = Trigger.GetComponent <TargetPlayerZombie1>();
        Zombie1     = GetComponent <Rigidbody2D>();

        scriptPlayer = Placescript.GetComponent <MovingPlayer>();
    }
    public virtual void NetworkStart()
    {
        player        = context.GetComponent <PlayerController>();
        moving_player = context.GetComponent <MovingPlayer>();

        isOwner         = (context as PhysicsPropHandler).isOwner;
        networkId       = (context as PhysicsPropHandler).networkId;
        isServer        = (context as PhysicsPropHandler).IsServer();
        networkedObject = (context as PhysicsPropHandler).networkedObject;
        enabled         = true;
    }
Beispiel #12
0
    void Start()
    {
        playerVel = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>();
        target    = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();
        player    = GameObject.FindGameObjectWithTag("Player").GetComponent <MovingPlayer>();
        //Текущая позиция камеры
        offset = transform.position;

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
    protected override Vector3 CalculatePlayerVelocity()
    {
        MovingPlayer player     = GetComponentInChildren <MovingPlayer>();
        Vector3      player_pos = Vector3.zero;

        if (player != null)
        {
            player_pos = player.transform.position - transform.position;
        }
        Vector3 rotating_velocity = Vector3.Cross(transform.TransformDirection(AngularVelocity), player_pos) * Mathf.Deg2Rad;

        return(velocity + rotating_velocity);
    }
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     player             = FindObjectOfType <MovingPlayer>();
     tiles              = GetComponentsInChildren <Tile>();
     list1              = new List <Tile>();
     list2              = new List <Tile>();
     list3              = new List <Tile>();
     list4              = new List <Tile>();
     timeUntilNextTiles = timeUntilTileChange;
     timeAfterFirst     = 0;
     firstDone          = false;
     secondDone         = false;
 }
Beispiel #15
0
    void Start()
    {
        // PlayerPrefs.SetInt("coundDiamond", 2354);
        PlayerGO         = GameObject.Find("kucha");
        Player           = PlayerGO.GetComponent <Rigidbody2D>();
        scriptMovePlayer = PlayerGO.GetComponent <MovingPlayer>();
        scriptPlayerHP   = PlayerGO.GetComponent <PlayerHP>();
        //Diamond = GameObject.Find("Diamond");
        //Box
        if (!PlayerPrefs.HasKey("coundDiamond"))
        {
            PlayerPrefs.SetInt("coundDiamond", 0);
        }

        CountDiamond    = PlayerPrefs.GetInt("coundDiamond");
        NewCountDiamond = CountDiamond;
    }
Beispiel #16
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            MovingPlayer script = collision.GetComponent <MovingPlayer>();
            script.health -= damage;
            script.hurtSound.Play();
            //ShakeScript sk = FindObjectOfType<ShakeScript>();
            //sk.shakeScreen();

            Destroy(gameObject);
        }
        if (collision.tag == "Tile")
        {
            if (collision.GetComponent <Tile>().getColor().Equals(Color.gray))
            {
                Destroy(gameObject);
            }
        }
    }
Beispiel #17
0
    static void switchPlayer(NetworkMessage netMsg)
    {
        canSwitchCameraView = true;

        var msg = netMsg.ReadMessage <MyMessage>();

        if (currentPlayer != null)
        {
            currentMovingPlayer.enabled = false;
            currentPlayer.transform.Find("UIoverlay").gameObject.SetActive(false);
            //hide that player's UI frame
        }

        GameObject go = ClientScene.FindLocalObject(msg.netId);

        currentPlayer               = go.GetComponent <Player>();
        currentMovingPlayer         = go.GetComponent <MovingPlayer>();
        currObservedPlayerId        = currentPlayer.netId;
        currentMovingPlayer.enabled = true;
        Transform uioverlay = currentPlayer.transform.Find("UIoverlay");

        uioverlay.gameObject.SetActive(true);
    }
Beispiel #18
0
 // Use this for initialization
 void Start()
 {
     timeUntilSoundCounter = timeUntilSound;
     player       = FindObjectOfType <MovingPlayer>();
     baseFireRate = fireRate;
 }
Beispiel #19
0
 private void Awake()
 {
     movement2D = GetComponent <MovingPlayer>();
 }
 void Start()
 {
     Player       = GameObject.Find("kucha");
     scriptPlayer = Player.GetComponent <MovingPlayer>();
 }
Beispiel #21
0
 public void SetPlayer()
 {
     script = FindObjectOfType <MovingPlayer>();
 }
Beispiel #22
0
 // Use this for initialization
 void Start()
 {
     healthBar = GetComponent <Image>();
     script    = FindObjectOfType <MovingPlayer>();
 }
Beispiel #23
0
 void Start()
 {
     anim  = GetComponent <Animator>();
     motor = GetComponent <MovingPlayer>();
 }