Ejemplo n.º 1
0
    void OnTriggerEnter(Collider Other)
    {
        Debug.Log("Collision");
        if (Other.gameObject.GetComponent("movementController") != null)
        {
            movementController theActor = Other.gameObject.GetComponent <movementController>();
            if (PickupEffect.Length > 0)
            {
                //theActor.inflicted = PickupEffect;
                theActor.moreThanOneEffect(PickupEffect);
            }
            //Debug.Log(Pickup.GetInstanceID());
            //if(Pickup.GetInstanceID() != float)
            //{

            //}
            //Pickup[0].h
            //collider.gameObject.GetComponent<movementController>().inflicted = Pickup[0].GetType("StatusEffect");
        }
        if (destroyOnEnter)
        {
            Debug.LogWarning("Play Effects!");
            Destroy(this.gameObject);
        }
    }
 //public float sizeOfBox;
 private void Awake()
 {
     cam = Camera.main;
     eventManagerObject = GameObject.FindGameObjectWithTag("EventManager");
     eventManagerScript = eventManagerObject.GetComponent <EventManager>();
     eventManagerScript.sendMeYourScreenPos.AddListener(sendScreenPos);
     movementControllerScript = GetComponent <movementController>();
 }
Ejemplo n.º 3
0
 public override void Initialize(GameObject obj)
 {
     Debug.LogWarning("Effector requires something to effect, how it will be effected.");
     effector  = obj;
     playerCon = obj.GetComponent <movementController>();
     //effector = obj;
     //////launcher = obj.GetComponent<ProjectileShootTriggerable>();
     //////launcher.projectileForce = projectileForce;
     //////launcher.projectile = projectile;
 }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        //input coordinates of verticies of 4 shape
        float[] vertexCoords =
        {
            -1.0f, -1.0f, -1.0f, -1.0f,
            1.0f,  -1.0f, -1.0f, -1.0f,
            -1.0f,  1.0f, -1.0f, -1.0f,
            1.0f,   1.0f, -1.0f, -1.0f,
            -1.0f, -1.0f,  1.0f, -1.0f,
            1.0f,  -1.0f,  1.0f, -1.0f,
            -1.0f,  1.0f,  1.0f, -1.0f,
            1.0f,   1.0f,  1.0f, -1.0f,
            -1.0f, -1.0f, -1.0f,  1.0f,
            1.0f,  -1.0f, -1.0f,  1.0f,
            -1.0f,  1.0f, -1.0f,  1.0f,
            1.0f,   1.0f, -1.0f,  1.0f,
            -1.0f, -1.0f,  1.0f,  1.0f,
            1.0f,  -1.0f,  1.0f,  1.0f,
            -1.0f,  1.0f,  1.0f,  1.0f,
            1.0f,   1.0f,  1.0f, 1.0f
        };

        //every pair shows indexes in vertexCoords that are connected by line.
        int[] edgeIndices =
        {
            0,   1,
            0,   2,
            0,   4,
            0,   8,
            1,   3,
            1,   5,
            1,   9,
            2,   3,
            2,   6,
            2,  10,
            3,   7,
            3,  11,
            4,   5,
            4,   6,
            4,  12,
            5,   7,
            5,  13,
            6,   7,
            6,  14,
            7,  15,
            8,   9,
            8,  10,
            8,  12,
            9,  11,
            9,  13,
            10, 11,
            10, 14,
            11, 15,
            12, 13,
            12, 14,
            13, 15,
            14, 15
        };

        //IN PROGRESS
        //used to darw faces for rendering
        int[] faceIndices =
        {
            0, 2, 1,
            1, 2, 3
        };


        //creating game objects and their components
        //hc = new Mesh4(vertexCoords, edgeIndices);
        GameObject mesh4_Object = new GameObject();

        mesh4_Object.transform.parent = transform;
        hc   = mesh4_Object.AddComponent <Mesh4>();
        rb4  = mesh4_Object.AddComponent <RigidBody4D>(); //Deek?
        mcon = mesh4_Object.AddComponent <movementController>();

        //calling each object or components initialization function
        hc.initialize(vertexCoords, edgeIndices);
        hc.triangles = faceIndices;
        rb4.initialize();
        mcon.initialize();
    }
Ejemplo n.º 5
0
    // Start is called before the first frame update
    void OnEnable()
    {
        movementController p = player.GetComponent <movementController>();

        p.client.SendData("S_SENDPROFILE:" + p.client.nickName);
    }
Ejemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     movC = this.gameObject.GetComponent <movementController>();
     movC.playerNumber = playerNumber;
 }