Example #1
0
    public Protien CreateRandomProtien()
    {
        GameObject go        = MonoBehaviour.Instantiate(Resources.Load("Prefabs/Protien")) as GameObject;
        Vector2    startVelo = new Vector2(Random.Range(-1f * startVeloSpeed, startVeloSpeed), Random.Range(-1f * startVeloSpeed, startVeloSpeed));

        go.GetComponent <Rigidbody2D>().velocity = startVelo;

        Protien toRet = go.GetComponent <Protien>();
        Color   color = GV.activeColors[Random.Range(0, GV.activeColors.Count)];

        toRet.Initialize(color);
        return(toRet);
    }
Example #2
0
 public void Throw(Protien toThrow)
 {
     toThrow.GetComponent <Rigidbody2D>().velocity = speed * speedMult;
 }