Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        rigid = GetComponent <Rigidbody>();

        GameObject Velocity = GameObject.Find("VelocityManager");

        scriptVelocity = Velocity.GetComponent <VelocityCalc>();
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject KinectAvatar = GameObject.Find("KinectAvatar");

        scriptBodySourceView = KinectAvatar.GetComponent <BodySourceView>();

        GameObject Velocity = GameObject.Find("VelocityManager");

        scriptVelocity = Velocity.GetComponent <VelocityCalc>();
    }
Beispiel #3
0
	void Start ()
	{
		velCalc = GetComponent<VelocityCalc>();

		if (!collisionTransform)
		{
			if (transform.childCount > 0)
			{
				collisionTransform = transform.GetChild(0);
			}
		}
	}
    void Update()
    {
        if (targets != null && targets.Length > 0)
        {
            if (_velocities == null)
            {
                _velocities = new List <VelocityCalc>();
                for (int i = 0; i < targets.Length; i++)
                {
                    var n = new VelocityCalc();
                    n.Init(targets[i]);
                    _velocities.Add(n);
                }
            }
        }

        //
        if (_velocities != null)
        {
            for (int i = 0; i < _velocities.Count; i++)
            {
                _velocities[i].Update();
                if (_velocities[i].velocity.magnitude > 0.04f)
                {
                    _Gen(targets[i].position);
                }

                for (int j = 0; j < _list.Count; j++)
                {
                    var d =
                        _list[j].transform.position - targets[i].position;
                    var d1 = d.normalized;

                    var d2 = _velocities[i].velocity.normalized;

                    var d3 = d1 * 2 + d2;

                    //とおいほど
                    var ff = 1f - d.magnitude / 1.5f;
                    if (ff < 0)
                    {
                        ff = 0;
                    }


                    d3 *= _velocities[i].velocity.magnitude * 4f * ff;

                    _list[j].AddVelocity(d3);
                }
            }
        }
    }
Beispiel #5
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject KinectAvatar = GameObject.Find("KinectAvatar");

        scriptBodySourceView = KinectAvatar.GetComponent <BodySourceView>();

        GameObject Velocity = GameObject.Find("VelocityManager");

        scriptVelocity = Velocity.GetComponent <VelocityCalc>();

        GameObject Table = GameObject.Find("Table");

        tableMovScript = Table.GetComponent <TableMovement>();
    }
Beispiel #6
0
    // Start is called before the first frame update
    void Start()
    {
        rb       = gameObject.GetComponent <Rigidbody>();
        tunnelRb = tunnel.GetComponent <Rigidbody>();

        GameObject KinectAvatar = GameObject.Find("KinectAvatar");

        scriptBodySourceView = KinectAvatar.GetComponent <BodySourceView>();

        GameObject Velocity = GameObject.Find("VelocityManager");

        scriptVelocity = Velocity.GetComponent <VelocityCalc>();

        GameObject arrow = GameObject.Find("arrow");

        arrowScript = arrow.GetComponent <arrowMovement>();
    }
Beispiel #7
0
    void Start()
    {
        popUp.CreatePopUp();

        GameObject KinectAvatar = GameObject.Find("KinectAvatar");

        scriptBodySourceView = KinectAvatar.GetComponent <BodySourceView>();

        GameObject Velocity = GameObject.Find("VelocityManager");

        scriptVelocity = Velocity.GetComponent <VelocityCalc>();

        GameObject spawnerRight = GameObject.Find("BallspwnerRight");

        scriptBallSpawnerRight = spawnerRight.GetComponent <BallSpwner>();

        GameObject spawnerLeft = GameObject.Find("BallspwnerLeft");

        scriptBallSpawnerLeft = spawnerLeft.GetComponent <BallSpwner>();

        GameObject spawnerBottom = GameObject.Find("BallspwnerBottom");

        scriptBallSpawnerBottom = spawnerBottom.GetComponent <BallSpwner>();
    }