Example #1
0
        public static Aminoacid Generate(AminoacidType type)
        {
            Aminoacid aminoacid = null;

            if (!Aminoacids.TryGetValue(type, out aminoacid))
            {
                throw new ArgumentException("Unhandled AminoacidType:" + type.ToString());
            }
            return(Aminoacids[type]);
        }
Example #2
0
    /// <summary>根据残基类型获取原子预制体</summary>
    private GameObject GetAtomPrefeb(AminoacidType aminoacidType)
    {
        GameObject prefeb = null;

        if (!AtomPrefebsDic.TryGetValue(aminoacidType, out prefeb))
        {
            prefeb = Resources.Load <GameObject>(string.Format("{0}/{1}", AtomSpherePrefebPath, aminoacidType.ToString()));
            AtomPrefebsDic.Add(aminoacidType, prefeb);
        }
        return(AtomPrefebsDic[aminoacidType]);
    }